#ifndef __STM32_USART_H__
#define __STM32_USART_H__

#include "type.h"
#include "stdio.h"

#define USART_REC_LEN 200 //定义最大接收字节数 200

extern u8 USART_RX_BUF[USART_REC_LEN]; //接收缓冲,最大USART_REC_LEN个字节.末字节为换行符
extern u16 USART_RX_STA;               //接收状态标记

uint16_t USART_BoundCul(u32 pclk2, u32 bound);
void USART1_Config(u32 pclk2, u32 BaudRate);
int mywrite(int ch);
void USART1_TimeOutCounter(void);
u8 USART1_ReceiveData(u8 *ReceiveData);
u8 USART1_SendData(u8 *SendData, u8 length);
#endif